/**
 * 
 */
package reducer;

import java.io.IOException;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

/**
 * @author puneet
 * 
 */
public class GraphReducer extends Reducer<Text, IntWritable, Text, IntWritable> {

	protected void reduce(Text key, Iterable<IntWritable> values,Context context)
			throws IOException, InterruptedException {
		int min = Integer.MAX_VALUE;
		for(IntWritable val:values) {
			if(val.get() < min) {
				min=  val.get();
			}
		}
		context.write(key, new IntWritable(min));
	}

}
